<?php
include("inc.php");
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title><?=$sitename?> | <?=$sitenameadd?></title>
<meta name="keywords" content="<?=$sitename?>" />
<meta name="description" content="<?=$sitedescription?>" />
<base href="<?=$baseurl?>">
<link href="main.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div id="main">
<div id="head">
<a href="./"><?=$sitename?></a>-<a href="wordlist.php/1/"><?=$sitenameadd?></a>
</div>
<div id="h">
  <div id="googlelink728X15">
  <script type="text/javascript"><!--
  google_ad_client = "pub-3493786795582708";
  google_ad_format = "js_sdo";
  google_cts_mode ="rs";
  google_num_cts = "10";
  google_searchbox_width = 215;
  google_searchbox_height = 26;
  google_link_target = 2;
  google_ad_channel = "6297994744";
  google_logo_pos = "left";
  google_rs_pos = "right";
  google_ad_height = 35;
  google_ad_width = 920;
//-->
</script>
<script type="text/javascript"
  src="http://pagead2.googlesyndication.com/pagead/show_sdo.js">
</script>

  </div>
</div>
<div style="height:90px;width:950px;margin:0 auto; margin-bottom:6px;margin-top:6px;">
<a href="http://www.51taonan.com/m/000234" rel="nofollow" target="_blank"><img src="http://www.51taonan.com/static/zh_cn/insidepage/market/default/images/staff/950_90.gif" border="0"/></a>
</div>
<div id="l">
<div style="padding: 10px;"><a href="./"><?=$sitename?></a> -> <a href="wordlist.php/1/"><?=$lang['alltopic']?></a> -> <?=$lang['latesarticle']?></div>

<div id="articlelist">
<?
$rs=mysql_query("SELECT `article`.`aid` , `article`.`title` , `article`.`description` ,  `article`.`author` ,`article`.`pinyin`,DATE_FORMAT(`article`.`pubtime`,'%Y-%m-%d') as `pubtime`,`word`.`pinyin` as `wordpinyin` FROM `article` join `word` on `word`.`wid`=`article`.`wid` order by `article`.`aid` DESC LIMIT 0 , 10");
if(@mysql_num_rows($rs))
{
	while ($rw=mysql_fetch_assoc($rs))
	{
?>
<div id="link"> <h2><a href="view.php/<?=$rw['wordpinyin']?>/<?=$rw['pinyin']?>-<?=$rw['aid']?>.html"><?=$rw['title']?></a></h2><?=$rw['author']?>  <?=$rw['pubtime']?></div>
<div id="desc"><?=$rw['description']?></div>
<?
	}
}
?>
</div>

<div id="google728x90">
<script type="text/javascript"><!--
google_ad_client = "pub-3493786795582708";
/* 728x90, 创建于 09-12-14 */
google_ad_slot = "6503528725";
google_ad_width = 728;
google_ad_height = 90;
//-->
</script>
<script type="text/javascript"
src="http://pagead2.googlesyndication.com/pagead/show_ads.js">
</script>
</div>
</div>
<div id="r">
<?php $i=rand(1,10);if(file_exists("smile/{$i}.jpg")){?>
<div id="pic"><img src="smile/<?=$i?>.jpg"></div>
<?}?>
<div id="google200X200">
<iframe scrolling="no" frameborder="0" marginheight="0" marginwidth="0" width="200" height="235" src="http://u.www.duba.net/union/db/style_1283.html?uid=41223&sid=0" id="ksu_style_1283"></iframe>
</div>
<div id="google200X200">
<script type="text/javascript"><!--
google_ad_client = "pub-3493786795582708";
/* 200x200, 创建于 09-12-14 */
google_ad_slot = "4616496781";
google_ad_width = 200;
google_ad_height = 200;
//-->
</script>
<script type="text/javascript"
src="http://pagead2.googlesyndication.com/pagead/show_ads.js">
</script>
</div>


<div id="w">
<?
$rs=mysql_query("SELECT `wid` , `word` , `pinyin` FROM `word` ORDER BY `wid` DESC LIMIT 0 , 10");

if($rs)
{
	while ($rw=mysql_fetch_assoc($rs))
	{
?>
<a href="list.php/<?=$rw['pinyin']?>/<?=$rw['wid']?>-p1.html"><?=$rw['word']?></a>
<?
	}
}
?>
</div>

</div>
<?php include("footer.php");?>
<?php
//更新采集
if($updatecaiji)
{
$rs=mysql_query("SELECT * FROM `src` WHERE (UNIX_TIMESTAMP( now( ) ) - UNIX_TIMESTAMP( `lasttime` ) ) > `updatetime` order by `sid` asc LIMIT 1");
if(mysql_num_rows($rs))
{
	$rw=mysql_fetch_assoc($rs);
	$array=caiji($rw['url'],$rw['pattern'],0);
	if($array)
	{
		foreach ($array[0] as $word)
		{
			if($rw['utf8']) $word=iconv("gbk","utf-8",$word);
			$pinyin=str_replace(array(" ","...","."),array("-"),$word);
			mysql_query("INSERT INTO `word` ( `wid` , `word` , `pinyin` , `updatetime` ) VALUES (NULL , '{$word}', '{$pinyin}', '0000-00-00 00:00:00');");
		}
		mysql_query("UPDATE `src` SET `lasttime` = NOW( ) WHERE `sid` ={$rw['sid']} LIMIT 1 ;");
	}
}
}
?>
